package common.inter;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;

import model.Wxuser;

public class ServiserInter implements Interceptor{

	@Override
	public void intercept(Invocation inv) {
		Controller con = inv.getController() ;
		Wxuser wxuser = con.getAttr("wxuser");
		if (!wxuser.isSeviserRole() && !wxuser.isStaffRole()) {
			con.renderJson(Ret.create("state","noAuth").set("err","无操作权限"));
			return ;
		}
		inv.invoke(); 
	}

}
